<div class="main-container">
    <div class="content-top-bar">
        <nz-radio-group [nzButtonStyle]="'solid'" [(ngModel)]="listType" (ngModelChange)="getListData()" style="margin-left: 15px">
            <label nz-radio-button nzValue="0">上报数据</label>
            <label nz-radio-button nzValue="1">指标查看</label>
            <label nz-radio-button nzValue="2" *ngIf="isDivBtnShow">指标分解</label>
        </nz-radio-group>

    </div>

    <div class="main-content">
        <div class="content-top-bar">
            <div class="search-box">
                <nz-form-item class="fileItem">
                    <nz-form-label>年份</nz-form-label>
                    <nz-form-control>
                        <nz-year-picker [(ngModel)]="year" (ngModelChange)="getMonthDetailData()">
                        </nz-year-picker>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item class="fileItem">
                    <nz-form-label>月份</nz-form-label>
                    <nz-form-control>
                        <nz-select nzAllowClear [(ngModel)]="monthSelection" (ngModelChange)="getMonthDetailData()">
                            <nz-option *ngFor="let item of monthOptions" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
                        </nz-select>
                    </nz-form-control>
                </nz-form-item>
                <nz-form-item class="fileItem" *ngIf="currentManageId == '10001'">
                    <nz-form-label>管理处</nz-form-label>
                    <nz-form-control>
                        <nz-select nzAllowClear [(ngModel)]="manageId" (ngModelChange)="getMonthDetailData()">
                            <nz-option *ngFor="let item of mngOption" [nzLabel]="item.label" [nzValue]="item.value"></nz-option>
                        </nz-select>
                    </nz-form-control>
                </nz-form-item>
                <button nz-button nzType="default" (click)="reset()">重置</button>

            </div>
            <div class="table-btn-group" *ngIf="listType=='0' && manageId != '10001'">
                <button nz-button nzType="primary" (click)="onEdit('add',null,1)">计划填报</button>
            </div>
        </div>

        <div class="table-content dark-blue-table">
            <nz-table #monthPlan nzSize="middle" nzBordered [nzData]="monthPlanDataFilter" [nzHideOnSinglePage]="true">
                <thead>
                    <tr>
                        <th style="width: 75px;">序号</th>
                        <th>计划名称</th>
                        <th>时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr *ngFor="let row of monthPlan.data; let idx = index">
                        <td>{{ idx + 1 }}</td>
                        <td>{{row.name}}</td>
                        <td>{{row.cycleName}}</td>
                        <td *ngIf="listType != '2'"> {{row.stateName}}</td>
                        <td *ngIf="listType === '2'"> {{row.divStateName}}</td>
                        <td class="table-btn">
                            <!-- 上报数据 -->
                            <a *ngIf="listType === '0'" (click)="onEdit('view',row,1)">查看</a>
                            <a *ngIf="listType === '0' && row.state=='0'" (click)="onEdit('edit',row,1)" [ngStyle]="{'point-events': 'none'}">修改</a>
                            <!-- 指标查看  数据分解-->
                            <a *ngIf="listType === '1' || listType === '2'" (click)="onEdit('view',row)">查看</a>
                            <!-- 数据分解 -->
                            <a *ngIf="listType === '2' && row.divState=='1'" (click)="onEdit('division',row)" [ngStyle]="{'point-events': 'none'}">分解</a>

                            <a *ngIf="listType === '2' && row.divState=='1'" (click)="exportMonthFile(row,'2')">导出</a>
                            <a *ngIf="listType != '2'" (click)="exportMonthFile(row,'1')">导出</a>
                        </td>
                    </tr>
                </tbody>
            </nz-table>
        </div>
    </div>
</div>